<?php


namespace App\Extensions\Column;


use Encore\Admin\Grid\Displayers\AbstractDisplayer;

class LayerShow extends AbstractDisplayer
{
    public function display($callback = '', $title = '详情',$width='1000',$height='800')
    {
        if ($callback instanceof \Closure) {
            $callback = $callback->bindTo($this->row);
            $href = call_user_func_array($callback, [$this->row]);
        } else {
            $href = $callback ?: $this->value;
        }
        return <<<EOT
  <a href="javascript:;" onclick="layer_show('{$title}','{$href}','{$width}','{$height}')">{$this->value}</a>
EOT;
    }
}
